-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make indirect drawing opt-out instead of opt-in, enabling multidraw by default. #16757
Conversation
default. This patch replaces the undocumented `NoGpuCulling` component with a new component, `NoIndirectDrawing`, effectively turning indirect drawing on by default. Indirect mode is needed for the recently-landed multidraw feature (bevyengine#16427). Since multidraw is such a win for performance, when that feature is supported the small performance tax that indirect mode incurs is virtually always worth paying. To ensure that custom drawing code such as that in the `custom_shader_instancing` example continues to function, this commit additionally makes GPU culling take the `NoFrustumCulling` component into account. This PR is an alternative to bevyengine#16670 that doesn't break the `custom_shader_instancing` example. **PR bevyengine#16755 should land first in order to avoid breaking deferred rendering, as multidraw currently breaks it**.
Did you mean to add the new component to custom_shader_instancing? |
@JMS55 Good catch, fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, and it works on my i5-1240P iGPU with Windows 10 and DX12.
Looks like the tests all passed except for some timeouts on Android that look like test flakiness rather than actual failures. |
This patch replaces the undocumented
NoGpuCulling
component with a new component,NoIndirectDrawing
, effectively turning indirect drawing on by default. Indirect mode is needed for the recently-landed multidraw feature (#16427). Since multidraw is such a win for performance, when that feature is supported the small performance tax that indirect mode incurs is virtually always worth paying.To ensure that custom drawing code such as that in the
custom_shader_instancing
example continues to function, this commit additionally makes GPU culling take theNoFrustumCulling
component into account.This PR is an alternative to #16670 that doesn't break the
custom_shader_instancing
example. PR #16755 should land first in order to avoid breaking deferred rendering, as multidraw currently breaks it.Migration Guide
GpuCulling
component is no longer available. To disable indirect mode, which may be useful with custom render nodes, add the newNoIndirectDrawing
component to your camera.